home *** CD-ROM | disk | FTP | other *** search
- Path: ub239.dialup.uwa.edu.au!not-for-mail
- From: prye@cyllene.uwa.edu.au (Peter Rye)
- Newsgroups: comp.lang.c
- Subject: Re: What is wrong in this code?
- Date: 14 Jan 1996 02:46:08 +0800
- Organization: The University of Western Australia
- Message-ID: <4d8ulg$ad@ub239.dialup.uwa.edu.au>
- References: <DL2z7o.2K5@scisun.sci.ccny.cuny.edu> <4d7kvv$j8@ub239.dialup.uwa.edu.au>
- NNTP-Posting-Host: ub239.dialup.uwa.edu.au
-
- prye@cyllene.uwa.edu.au (Peter Rye) writes:
-
- Oops!! Sorry I think I've written some rubbish.
-
- >>x = pow(x,x);
- > ^-------------------- This line is a problem.
- > I believe this will give rise to
- > "undefined behavior" because you
- > are modifying x using a function
- > which takes x as an argument.
- > Use something like y = pow(x,x);
- > Where y is declared as a double,
- > then use y in the printf below.
-
- Having thought about this further I think this is legal code.
- Sorry!!!
-
- --
- | Peter Rye |
- | Respiratory Research Fellow |
- | Princess Margaret Hospital for Children |
- | Perth, Western Australia |
-